package com.wantyx.creation.factory.factorymethod;

import com.wantyx.bean.database.Mysql;
import lombok.extern.slf4j.Slf4j;

/**
 * 作者 : wantyx
 * 创建时间 : 2023/11/2
 * 实现功能 : Mysql的工厂类，继承自公共接口。
 */
@Slf4j
public class MysqlFactory implements IDataBaseFactory<Mysql> {
    private static final MysqlFactory instance = new MysqlFactory();
    private MysqlFactory(){}
    public static MysqlFactory getInstance(){
        return instance;
    }
    @Override
    public Mysql createHandler() {
        String userName = "userName";
        String password = "password";
        Mysql mysql = new Mysql();
        mysql.setUserName(userName);
        mysql.setPassword(password);
        log.info("构建mysql");
        return mysql;
    }
}
